Equivalence Classes
In this example, equivalence classes and Equivalence Classes assesslets are used. Equivalence classes are sets of values in which a system should behave identically.
Open the file Help|Examples|06 Test Methods|02 Equivalence Classes. Select View|Declaration Editor to open the Declaration Editor. The editor contains the channels cooler_voltage
and engine_temperature
.
It is to be checked if the cooler_voltage
signal values are always in the IDLE classes and if the engine_temperature
signal values fall in the SAFE or DANGEROUS classes.
The test cases engine temperature and cooler voltage changing and engine temperature changing and cooler voltage constant idle reflect this behavior. Using the Equivalence Classes assesslet, the following intervals are set to be mandatory and forbidden:
We set the DANGEROUS classes to be forbidden and the SAFE classes to be mandatory for the engine_temperature
channel. It is to be checked if the engine temperature gets dangerously hot (between 120 and 180) or if it remains between 0 and 120.
It is also to be checked if the cooler_voltage
channel stays in IDLE class during the test execution. Select the Test Cases folder in the Project view and execute all test cases.
The Overview report shows an Equivalence Class Coverage table, where you can see that the motor temperature was never found to be DANGEROUS and that the cooler voltage was never found to be HIGH.
The test case equivalence classes and boundary values fails because the DANGEROUS class was set to be forbidden but it was found.
The test case engine temperature and cooler voltage changing succeeds because the DANGEROUS class was set to forbidden and was not found and cooler voltage is always IDLE (mandatory). The same applies to the test case engine temperature changing and cooler voltage constant idle.
Related topics